package com.raycloud.erp.omll.provider.enums;

/**
 * @Author 杨恒
 * @Email baixue.yh@raycloud.com
 * @Date 2019-11-15 17:33
 * @Description 库存状态枚举
 */
public enum StockStatusEnum {

    STOCK_STATUS_EMPTY("EMPTY", "库存不足"),

    STOCK_STATUS_NORMAL("NORMAL", "正常"),

    STOCK_STATUS_UNALLOCATED("UNALLOCATED", "商品未分配"),

    STOCK_STATUS_INSUFFICIENT("INSUFFICIENT", "库存不足"),

    STOCK_STATUS_RELATION_MODIFIED("RELATION_MODIFIED", "商品对应关系修改"),

    STOCK_STATUS_EXCEP("EXCEP", "库存不足");

    public String stockStatus;

    public String msg;

    StockStatusEnum(String stockStatus, String msg) {
        this.stockStatus = stockStatus;
        this.msg = msg;
    }

    public static String getMsgByStockStatus(String stockStatus) {
        for (StockStatusEnum stockStatusEnum : StockStatusEnum.values()) {
            if (stockStatusEnum.stockStatus.equalsIgnoreCase(stockStatus)) {
                return stockStatusEnum.msg;
            }
        }
        return "未知的库存状态";
    }
}
